GtkSearchEntry: fix search_entry_clear_cb()
authorSébastien Wilmet <swilmet@gnome.org>
Sat, 13 Jul 2013 19:07:08 +0000 (21:07 +0200)
committerSébastien Wilmet <swilmet@gnome.org>
Mon, 15 Jul 2013 10:27:21 +0000 (12:27 +0200)
When the icon-release signal is emitted on a GtkSearchEntry, the
contents is now cleared only if it's for the secondary icon. The primary
icon can be used for another purpose.

https://bugzilla.gnome.org/show_bug.cgi?id=704164

gtk/gtksearchentry.c

index 6179dc04d92bee79dcf5d3d1c0447040f2762067..c785a084469e7d02cc6c8601c406cdb429c92d31 100644 (file)
@@ -83,10 +83,12 @@ gtk_search_entry_class_init (GtkSearchEntryClass *klass)
 }
 
 static void
-search_entry_clear_cb (GtkEntry *entry,
-                       gpointer  user_data)
+search_entry_clear_cb (GtkEntry             *entry,
+                       GtkEntryIconPosition  icon_pos,
+                       gpointer              user_data)
 {
-  gtk_entry_set_text (entry, "");
+  if (icon_pos == GTK_ENTRY_ICON_SECONDARY)
+    gtk_entry_set_text (entry, "");
 }
 
 static gboolean